package com.dailyblue.java.thread.生产者消费者;

import lombok.SneakyThrows;

public class 消费者 extends Thread {
    private 经销商 jxs;

    public 消费者(经销商 jxs) {
        this.jxs = jxs;
    }

    @SneakyThrows
    public void run() {
        for (int i = 0; i < 20; i++) {
            产品 cp = jxs.售卖();
            System.out.println("顾客购买了:" + cp);
            Thread.sleep(3000);
        }
    }
}
